<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	
	<body>
		
		
		<div>
			<a href="http://www.taobao.com" target="_blank">淘宝</a>
			<a href="http://www.jd.com" target="_blank">京东</a>
			<a href="http://www.pinduoduo.com" target="_blank">拼夕夕</a>
		</div>
		
		<script>
			//获取a标签
			//方式一:通过TagName取获取它对象和属性值
			console.log(document.getElementsByTagName("a"));
			//获取第一个值
			console.log(document.getElementsByTagName("a")[0].href);
			console.log(document.getElementsByTagName("a")[0].innerText);
			
			console.log(document.getElementsByTagName("a")[1].href);
			console.log(document.getElementsByTagName("a")[1].innerText);
			
			console.log(document.getElementsByTagName("a")[2].href);
			console.log(document.getElementsByTagName("a")[2].innerText);
		</script>
		
		
	</body>
</html>
